package com.synjones.zeus.model.ykt.userinfo;

/**
 * 用户卡类型枚举
 *
 */
public enum UserCardState {
    _1("1", "学生"),
    _2("2","教工"),
    _3("female","外来人员");

    /**状态码*/
    private final String code;
    /**状态码描述*/
    private final String desc;

    UserCardState(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * 根据code获取描述
     * @param code
     * @return
     */
    public static String getDesc(String code) {
        for (UserCardState info : UserCardState.values()) {
            if (code.equals(info.code)) {
                return info.desc;
            }
        }
        return null;
    }
}
